module Geometry.FocalPlane ( guides
                           , getDeviceVector
                           , focalScale 
                           , radiusFieldOfView) 
       where

import Handler.Types ( Instrument(..) )

import Geometry.Intersection
import Geometry.FPlaneVisibility
                

         
focalScale :: Double
focalScale = 180*3600*0.082/pi

radiusFieldOfView :: Angle
radiusFieldOfView = 0.4
                     
getDeviceVector :: Instrument -> Vector
getDeviceVector inst =
  case inst of
    UVES  -> a
    VUVES -> b
    LSS   -> c
    ISSIS -> (0,0)
  where
    (a:b:c:_) = rotate (pi/6) $ makeTriangle ((50,0) :: Point)

guides = rotate (pi + pi/30) $ makeTriangle $ translate (60,0) $ rectangle 16 16

makeTriangle a = let p = rotate (2*pi/3) in [a, p a, (p.p) a]
                    
rectangle :: Double -> Double -> Polygon
rectangle a b = scale 0.5 $ [(a,b), (-a,b), (-a,-b), (a,-b)]